<?php
$s = new SaeStorage();
if($_FILES["weibo_image"]){
	$filename = strtotime("now");
	$filename = md5($filename);
	$filetype = explode(".",$_FILES["weibo_image"]["name"]);
	$filename = $filename.".".$filetype[count($filetype)-1];
	$filecontent = file_get_contents($_FILES["weibo_image"]["tmp_name"]);
	$url = $s->write("cache","images/".$filename,$filecontent);
	unlink($_FILES["weibo_image"]["tmp_name"]);
	if($url){
		header("Location: /getimage?url=".urlencode($url));
	}
}
?>